EXTENSIONS: Issue #4
For the PRO/FILE 2068 user
I want to thank everyone for your support. Many very complimentary
letters have been received and repeat orders would certainly seem to imply
satisfaction.
At the time I write this, I am about out of ideas and 1 don’t
particularly want to turn this into a newsletter that does little more than
provide new ways to use PRO/FILE. It has always been intended as a way to
improve on the original program.
Barring a sudden turn of events (either I get more ideas or my
customers send me some), this could be the last issue. About the only
remaining idea I have would involve making PRO/FILE handle more lines of
data, probably 17. Time will tell, but any suggestions or request for
routines may help a lot. There is a possibility that I could develop some
specialty programs which would not be included within Pro/File itself, but
could operate on the same data. Let me Know what you think and what you’d
like to see.
This issue will concentrate on flexibility. That is, there will not be
as many new routines, but more options will be available on the existing
ones. This can cause you to change the reasons for using PRO/FILE.
For example, when I was restricted to using a tape drive, I Kept only
two different files. One was for all my band records such as student
addresses, inventory, schedules, etc. The other Kept track of my customers.
Since it. took so long to load and save (and verify), it was impractical to
have more. However, after converting to a Spectrum ROM (with a ROMSWITCH)
and adding Sinclair microdrives, I am adding new files regularly. They
load, save, and verify so quickly that my whole approach is different.
The changes in this issue will cause a reduction in file capacity.
Change the size of D$ in line 9996 to 27529. That value seems to work with
me. If you use a Spectrum, you have more memory available and shouldn’t
need to reduce it (actually you could probably increase it) so ignore any
reduction instructions.
One of the changes in this issue permits you to do a TALLY or a SUM
search on any line you select. When I was limited to one line, I made
little use of the SUM routine and no use of TALLY. Now I can set up a file
for each of my products which I sell in a year. Each line could represent a
different month’s sales and by searching and calculating the appropriate
line I could check the total profits or gross sales in a given month. There
are certainly similar possibilities you may find. Granted, these routines
are not fast, but they could suit your purposes if you are not prepared to
invest in a major financial program. Of course, the numbers to be
calculated do not need to represent monetary values.
To allow you to select any line for SUM or TALLY just make the
following changes:
130 LET J$=CHR$ PEEK VAL "23670
": IF J$="T" OR J$="S" THEN INPU
T "WHICH LINE TO CALCULATE? *;RW
: IF RW<U OR RW>J THEN GO TO VAL
"130°
7200 POKE VAL "63798", J+U: LET E
$C RW=ES(RW): IF USR VAL "63792"
THEN LET T=T+VAL ES(RW, TO J+U)
9205 LET E$(RW,J+H)=E$(RW,J+H) :
IF USR VAL "63792" THEN LET TO=T
O+VAL ES(RW,J+H TO )
9250 POKE VAL "63798" ,Q@: LET ES<
RW)=ES(RW): IF USR VAL "63792" T
HEN LET T=T+VAL E$(RW): LET TO=V
AL E$(RW)
Whenever you do a TALLY or SUM search, the input line at the bottom of
the main menu will prompt you to input the line number you wish to
calculate. Once you enter that number, the routine will continue as before.
You may also prefer to have the name reverse routine operate on a line
different from line 1. Any change on this must become a permanent change in
the program unlike the previous improvement which allows a selection
process. The lines which tell the program to work on line 1 are listed
below. In each of these lines, you will notice a reference to ES(U) - there
may be something after the "U" such as in E$(U,X) but it doesn’t matter.
The "U" refers to line #1. To change the line to another just change every
"U" in that position to the line number you prefer.
Here are the lines to change:
7207, 7209, 7219, 7211
Remember to make a new master copy so your changes become permanent.
When you set up the print format, you can just enter ALL to print out
the whole file. Unfortunately, no space is printed between files. I could
be wrong, but I think in most cases a space would be desired so I changed
the routine so that whenever ALL is the print format, a blank line is
printed first. If you don’t want the space, you will need to enter the
format as: 1/2/3/4/5/6/7/ etc.
6515 IF A$="ALL/" THEN LET C$=CH
R$ 0: FOR X=U TO J: LET C$=C$+CH
R$ X: NEXT X: LET D=INT PI: GO T
0 VAL "6600"
9996 DIM D$(VAL "27529"): LET P=
VAL "20": LET OG=NOT PI: LET B=0:
LET U=SGN PI: LET H=U+U: LET F=
H+H: LET G=VAL "7": LET K=VAL "i
0": LET J=VAL "15": LET G=CODE "
": LET R=VAL "256"; LET A$="ALL
": LET C$=CHR$ O: FOR X=U TO J:
LET C#=C$+CHR$ X: NEXT X: LET S=
0
Here’s a little item which doesn’t seem very useful at first, but 1
refer to it all the time now. In the first file (the one that says "SEARCH
IS COMPLETE") 1 added a second line that holds 8 characters for the date
such as 12/25/85. Any 8 characters (or less) can be used. When a file is
created it will say "SET DATE" as a reminder to do so. Not only is the date
seen every time you complete a search, but it also appears on the main
menu. To change the date just enter "DATE" as a search command and you will
be prompted to enter the date.
Later, when this file is loaded back in, you will be able to see when
you last worked on the file. Often this has helped me remember what I have
left to do.
First POKE 64732,27 to correct the machine code sort since the first
file is now longer.
3 LET D$: TO J+F)="*SEARCH IS
COMPLETE": POKE VAL "23609" ,E:
LET J$="": LET A=O: LET X$="": L
ET T=0: LET T0=0
104 IF X$="RST" THEN LET P=VAL
"29": G0 TO U
105 IF X$="DATE" THEN INPUT "NE
W DATE: ";D$(VAL "21" TO G*F): G
0 TOU
106 INK F+U: CLS : IF X$="A" TH
EN GO TO VAL "5000"
107 1F X$="LOAD" THEN GO TO VAL
"5500"
108 IF X$="SAVE" THEN GO TO VAL
"8200"
107 IF X$="T" THEN LET E=ABS (E
-K): GO TO U
9850 PRINT "FILE: "; INK G;F$; 1
NK INT PI; ORDER: "; INK G;
S, INK INT P1;"OPEN: "; INK G;LE
N D$-P;: PRINT " bytes DATE:";
INK G;D$<VAL "21" TO F*G);TAB O;
: PRINT "FORMAT:"; INK G;A$,,,TA
B O;: RETURN
9996 DIM D$(VAL "°27529"): LET P=
VAL "29": LET O=NOT PI: LET B=0:
LET U=SGN PI: LET H=U+U: LET F=
H+H: LET G=VAL "7": LET K=VAL "1
0": LET J=VAL "15": LET G=CODE "
": LET R=VAL "256": LET AS="ALL
": LET C$=CHR$ O: FOR X=U TO J:
LET C$=C$+CHR$ X: NEXT X: LET S=
O: LET D$<(K+K TO VAL "29")=CHRE
U+"SET DATE#"
To adjust your existing files to hold a date you must first have
finished all the enhancements from this issue (at least this improvement
and the one for combining files). After you have safely made a master copy,
load in a data tape but select the MERGE option instead of just load. When
back at the main menu, search for the name of the file just merged. You
will see the remains of the file that used to say "SEARCH IS COMPLETE", but
now has been overwritten with the file name and the value of P (length of
data used). This file is now garbage so delete it. Now you can set the date
3
and save it out again and you are done. Only merge a data tape into a new
(that is empty) file. If you have another one to load in you can
effectively erase the present one by entering "RST" at the main menu (be
sure you have saved it first). When the files have each been handled this
way, you can load them in the regular way.
The name reverse routine can be cancelled out while operating with the
following changes. Remember that any time you press ENTER the routine is
activated and if you press the space bar, it is deactivated. You can switch
back and forth as it runs if you wish.
1020 IF B<P THEN LET T1i=T1+U: IF
Y AND A=0 THEN GO TO VAL "7204"
7204 IF INKEY$=" " THEN IF Y=H T
HEN LET Y=U
Combining files is another of those routines which can change the way
you approach PRO/FILE. In my case, I have lists of band music for Georgia.
There are 6 lists, but there is only enough room in the program for 2 at a
time. Originally I had one file containing lists 1 and 2, another with 3
and 4, and another with 5 and 6. Unfortunately, at the beginning of the
year my junior high band is dealing with the first and second list, but
later moves on to the second and third. Meanwhile, the high school starts
with 3 and 4, and later with 4 and 5. Some years they end up with 5 and 6.
This made it difficult to have all the music 1 wanted for a particular band
in the computer at the same time.
The ability to combine files solves all that. Now 1 Keep a separate
file for each list (in my case this is on a microdrive cartridge), and load
in the first file I want and then merge in the second. The flexibility is
great for my needs.
The routine works like this. Anytime you want to load a file, the
computer will ask whether you wish to LOAD or MERGE the file. A load acts
as you would expect, but merge keeps whatever file is in the computer and
adds the new one on to the end of it. Obviously, the total amount of data
of each file cannot exceed the size of D$ or you program will crash and you
will have to start over with the master copy. It is up to you to avoid this
situation!!!
When you merge another file, you must delete the file which used to
say "SEARCH IS COMPLETE". However, since this is temporarily altered during
a data save it will now hold the name of the file followed by the value of
P, and then the remaining characters normally in the file. This should be
deleted since you already have a "SEARCH IS COMPLETE" file. Just search for
the file name and you should see the file come up. Now just enter "D"* to
delete it.
Your files are now combined with the garbage removed. Please note that
with dated files, the program retains the date from the first file loaded,
however, the program wil] change to the name of the last file merged. If
you want to change the name remember to input "NN" at the main menu.
Besides my use of this routine, there is at least one other use,
Suppose you have several people who want to create a particularly large set
of files. Each person could be assigned a section of the work and later
each section could be combined!
Make the following changes:
5505 PRINT AT J+U,U;" LOAD DAT
A ONLY? (Y OR N) ": PAUSE O: L
ET X$=INKEY$: IF X$="Y" OR X$="y
" THEN PRINT AT VAL "18",G;"L)0A
D OR M)ERGE?": FOR X=U TO J: NEX
T X: PAUSE O: LET P$=INKEY$: IF
P$<>"M" AND P$<)"m" THEN LET P=U
3506 IF X$="Y" OR X$="y" THEN LE
T P=P-U: LOAD ""CODE PEEK VAL "2
3627"°+R*PEEK VAL "23628"+P4+G-U:
LET F$=D$(P+H TO P+G+F): LET P=P
+VAL DS(P+K+H TO P+J+U): BEEP U/
H,J+J: GO TO U
550? IF X$<>"N" AND X$<>"n" THEN
GO TO VAL "5505"
If you are using Sinclair microdrives, then also change:
3803 CLS : PRINT AT K,G;"L)OAD 0
R M)ERGE?": PAUSE O: LET Q@$=INKE
Y$: IF Q$<>"M" AND @$<>"m" THEN
LET P=U
5805 LET P=P-U: LOAD *"M";U;FSCO
DE PEEK VAL "23627"+R*PEEK VAL "
23628" +P+G-U
5806 LET FS=D$(P+H TO P+G+F): LE
T P=P+VAL D$(P+K+H TO P+J+U): BE
EP U/H,J+J: GO TO U
Speaking of microdrives, making the following changes will allow you
to select any drive you want when saving or loading data:
5503 CLS : PRINT AT K,O;"T for T
ape or 1-8 for microdrive": PAUS
E 0: LET P$=INKEY$: GO TO VAL "5
503"+(U AND P$="T" OR P$="t")+(Ų
AL "297" AND P$>"0" AND P$<"9")
5800 LET X=VAL P$: PRINT AT J+U,
F;"INPUT FILE NAME TO LOAD",: IN
PUT F$: IF LEN F$<U OR LEN F$)K
THEN GO TO U
5805 LET P=P-U; LOAD *"M";X;F$CO
DE PEEK VAL "23627"+R*PEEK VAL "
23628" +P+G-U
8202 CLS : PRINT AT K,O;"T for T
ape or 1-8 for microdrive”: PAUS
E 0: LET P$=INKEY$: GO TO (VAL "
8300" AND P$>"0" AND P$<"9")+(VA
L "8205" AND P$="T" OR P$="t")
8300 LET X=VAL P$: CLS : IF X$="
D" THEN LET D$(H TO G+F)=F$: LET
D$(K+H TO J+U)=STR$ P: ERASE "M
"3X;F$: SAVE *"M";X;FSCODE PEEK
VAL "23627"+R*PEEK VAL °23628"+6
-U,P: VERIFY #"M";X;FSCODE PEEK
VAL °23627"°+R#PEEK VAL "23628"+G
-U
In our neverending efforts to improve and simplify the creation and
editting of files, we have added UPDATE, DUPLICATE, and other options.
Here’s one more. There may be many cases where you want to put the same
data in different files, but UPDATE is not appropriate. The following
changes allow you to imput a set number of characters (up to 32) which will
be added to a file in any position at the press of two Keys (symbol shift
and "I" which results in "AT").
When at the main menu, enter "EDIT" and then you will be prompted to
enter the edit phrase. Once entered, it is retained until you use UPDATE or
load in your master copy again. Since UPDATE uses the variable P$ to hold
the data to change and this routine uses it to hold the edit phrase, you
need to be Keep track of what you are doing or you may be putting in
information you don’t want.
Whenever you add or edit a file, just place the cursor where you want
the phrase to begin and press symbol shift-I (the AT token) and the phrase
will instantly appear. If in OVER mode, the phrase will cover any data
already there. If you have a 20 character phrase and try to put it in
starting in column 25, you will cut off most of the phrase at the end of
course. If you are in INSERT mode, the characters on the line from the
cursor position to the end will be moved to the right. Anything moved past
the last column is cut off and lost forever (always have backups of data!).
Again, there are many situations where this would be useful. In my
case, I always put the date on each order I receive. If I have to do very
many files in one day, this makes things much easier.
Here are the changes:
100 LET Ti=0: INPUT "SEARCH COM
MAND? ";X$: IF X$="NN" THEN GO T
0 VAL "9998"
101 IF X$="EDIT" THEN INPUT “ED
IT PHRASE: ";P$: GO TO U
5028 IF Y$="AT " AND I THEN LET
Q$=E$(L+1,C+2 TO ): LET E$<L+1,C
+1 TO )=P$+0$: PRINT AT L,O;E$(L
+1): LET C=(C+LEN P$)#(C+LEN P$<
31): GO TO 5035
5029 IF Y$="AT " AND NOT I THEN
LET Q$=E$(L+1,C+1+LEN P$ TO ): L
ET ES(L+1)=ES(L+1, TO C)+P$+Q$:
PRINT AT L,O;ES(L#1): LET C=(C#L
EN P$)*(C+LEN P$<31): GO TO 5035
5030 PRINT AT L,C;Y¥$: LET ES<L+i
„C+1)=Y$: LET C=(C+1)#(C<31)
5035 LET L=L+(C=0 AND L<14): FLA
SH 1: PRINT AT L,C;SCREEN$ (L,C)
9996 DIM D$(VAL "27529"): LET P=
VAL "29": LET P$="": LET O=NOT P
I: LET B&O: LET U=SGN PI: LET He
U+U: LET F=H+H: LET G=VAL "7": L
ET K=VAL "10": LET J=VAL "15": L
ET @CODE " ": LET R=VAL "256":
LET AS="ALL": LET C$=CHR$ O: FOR
X=U TO J: LET C$=C$+CHRS X: NEX
T X: LET S=O: LET D$<(K+K TO VAL
"29" =CHRS U+"SET DATE"
That just about does it for this issue. 1 hope you have found my
improvements worthwhile.
ROBERT C. FISCHER; 221 SCOGGINS ST; SUMMERVILLE, GA. 30747